package hcn.protocol.brandnew.feiyong.feiyongqingdan;

import lombok.Data;
import javax.xml.bind.annotation.*;
import java.util.List;
import hcn.protocol.brandnew.BaseRequest;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import org.atag.sysrouter.annotation.DictionaryMapping;

import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;


/**
 * 门诊待支付信息通知-请求信息 - ODS_04010006
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "MsgBody")
@XmlAccessorType(XmlAccessType.FIELD)
public class PayTradeNoticeByHisRequest extends BaseRequest {

    /**
     * 待支付集合
     */
    @XmlElementWrapper(name = "Certificates")
    @XmlElement(name = "Certificate")
    private List<Certificate> certificates;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Detail {

        /**
         * 就诊日期时间
         */
        @XmlElement(name = "VisitDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date visitDateTime;
        /**
         * 科室代码
         */
        @XmlElement(name = "DeptCode")
        private String deptCode;
        /**
         * 科室名称
         */
        @XmlElement(name = "DeptName")
        private String deptName;
        /**
         * 操作医生编码
         */
        @XmlElement(name = "DoctorId")
        private String doctorId;
        /**
         * 操作医生姓名
         */
        @XmlElement(name = "DoctorName")
        private String doctorName;
        /**
         * 总计金额
         */
        @XmlElement(name = "TotalCost")
        private String totalCost;
        /**
         * 就诊备注
         */
        @XmlElement(name = "Remark")
        private String remark;
        /**
         * 就诊医疗机构组织机构代码
         */
        @XmlElement(name = "VisitOrganization")
        private String visitOrganization;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Certificate {

        /**
         * 身份证件号码
         */
        @XmlElement(name = "IdCard")
        private String idCard;
        /**
         * 身份证件类别代码
         */
        @XmlElement(name = "IdCardCode")
        @DictionaryMapping(id = "CV02_01_101")
        private String idCardCode;
        /**
         * 支付明细集合
         */
        @XmlElementWrapper(name = "Details")
        @XmlElement(name = "Detail")
        private List<Detail> details;
    }

}
